<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>The small3d library: small3d::Model Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo_s.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">The small3d library
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacesmall3d.html">small3d</a></li><li class="navelem"><a class="el" href="classsmall3d_1_1_model.html">Model</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classsmall3d_1_1_model-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">small3d::Model Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A 3D model. It can be loaded from a <a class="el" href="classsmall3d_1_1_wavefront_file.html" title=".obj (Wavefront) file parser class. The file format has to be somewhat specific, with triangulated fa...">WavefrontFile</a> or <a class="el" href="classsmall3d_1_1_glb_file.html" title=".glb (glTF) file parser class. It can load meshes, textures and linear animations from samplers with ...">GlbFile</a>. It can also be constructed procedurally by code, by inserting values to the appropriate member variables.  
 <a href="classsmall3d_1_1_model.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_model_8hpp_source.html">Model.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsmall3d_1_1_model_1_1_joint.html">Joint</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">animation joint  <a href="structsmall3d_1_1_model_1_1_joint.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsmall3d_1_1_model_1_1_joint_animation.html">JointAnimation</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">animation for joint  <a href="structsmall3d_1_1_model_1_1_joint_animation.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsmall3d_1_1_model_1_1_joint_animation_component.html">JointAnimationComponent</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">animation component for joint  <a href="structsmall3d_1_1_model_1_1_joint_animation_component.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa116b5b0c66b9e7f4dfd401ab5233a79"><td class="memItemLeft" align="right" valign="top"><a id="aa116b5b0c66b9e7f4dfd401ab5233a79"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#aa116b5b0c66b9e7f4dfd401ab5233a79">Model</a> ()</td></tr>
<tr class="memdesc:aa116b5b0c66b9e7f4dfd401ab5233a79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <br /></td></tr>
<tr class="separator:aa116b5b0c66b9e7f4dfd401ab5233a79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c2157a917298623136e6eea94ac67bd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a0c2157a917298623136e6eea94ac67bd">Model</a> (<a class="el" href="classsmall3d_1_1_file.html">File</a> &amp;file, const std::string &amp;meshName=&quot;&quot;)</td></tr>
<tr class="memdesc:a0c2157a917298623136e6eea94ac67bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="classsmall3d_1_1_model.html#a0c2157a917298623136e6eea94ac67bd">More...</a><br /></td></tr>
<tr class="separator:a0c2157a917298623136e6eea94ac67bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc694ba2760a1a3fa8775e6abe1a0d0e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#acc694ba2760a1a3fa8775e6abe1a0d0e">Model</a> (<a class="el" href="classsmall3d_1_1_file.html">File</a> &amp;&amp;file, const std::string &amp;meshName=&quot;&quot;)</td></tr>
<tr class="memdesc:acc694ba2760a1a3fa8775e6abe1a0d0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor (rvalue file - helps for declaring the file on the fly when using gcc)  <a href="classsmall3d_1_1_model.html#acc694ba2760a1a3fa8775e6abe1a0d0e">More...</a><br /></td></tr>
<tr class="separator:acc694ba2760a1a3fa8775e6abe1a0d0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab45b976e6906c2f86ae5d47d90ed3cd6"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#ab45b976e6906c2f86ae5d47d90ed3cd6">getNumPoses</a> ()</td></tr>
<tr class="memdesc:ab45b976e6906c2f86ae5d47d90ed3cd6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of animation poses in the current animation.  <a href="classsmall3d_1_1_model.html#ab45b976e6906c2f86ae5d47d90ed3cd6">More...</a><br /></td></tr>
<tr class="separator:ab45b976e6906c2f86ae5d47d90ed3cd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a017c394b7f032e79786f043df8ca0fb9"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a017c394b7f032e79786f043df8ca0fb9">getNumAnimations</a> ()</td></tr>
<tr class="memdesc:a017c394b7f032e79786f043df8ca0fb9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of available animations.  <a href="classsmall3d_1_1_model.html#a017c394b7f032e79786f043df8ca0fb9">More...</a><br /></td></tr>
<tr class="separator:a017c394b7f032e79786f043df8ca0fb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ae390be2c19fcbd81829341fc8cafa3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a7ae390be2c19fcbd81829341fc8cafa3">setAnimation</a> (uint32_t animationIdx)</td></tr>
<tr class="memdesc:a7ae390be2c19fcbd81829341fc8cafa3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the current animation.  <a href="classsmall3d_1_1_model.html#a7ae390be2c19fcbd81829341fc8cafa3">More...</a><br /></td></tr>
<tr class="separator:a7ae390be2c19fcbd81829341fc8cafa3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6100343932704c5e7a647a13aaae7586"><td class="memItemLeft" align="right" valign="top">glm::mat4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a6100343932704c5e7a647a13aaae7586">getJointTransform</a> (size_t jointIdx, uint32_t animationIdx, uint64_t currentPose, float seconds=0.0f)</td></tr>
<tr class="memdesc:a6100343932704c5e7a647a13aaae7586"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a joint transform, also calculating the transorms of the parent joints in the same tree and the animations, if any exist.  <a href="classsmall3d_1_1_model.html#a6100343932704c5e7a647a13aaae7586">More...</a><br /></td></tr>
<tr class="separator:a6100343932704c5e7a647a13aaae7586"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0595f6078b8bddee06a33a11f46dadc"><td class="memItemLeft" align="right" valign="top"><a id="ac0595f6078b8bddee06a33a11f46dadc"></a>
glm::vec3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#ac0595f6078b8bddee06a33a11f46dadc">getOriginalScale</a> ()</td></tr>
<tr class="memdesc:ac0595f6078b8bddee06a33a11f46dadc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the <a class="el" href="classsmall3d_1_1_model.html" title="A 3D model. It can be loaded from a WavefrontFile or GlbFile. It can also be constructed procedurally...">Model</a>'s original scale (usually the one read from the file the <a class="el" href="classsmall3d_1_1_model.html" title="A 3D model. It can be loaded from a WavefrontFile or GlbFile. It can also be constructed procedurally...">Model</a> was loaded from. <br /></td></tr>
<tr class="separator:ac0595f6078b8bddee06a33a11f46dadc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab20d35ec5c791220790e149546c37553"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#ab20d35ec5c791220790e149546c37553">saveBinary</a> (const std::string binaryFilePath)</td></tr>
<tr class="memdesc:ab20d35ec5c791220790e149546c37553"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save model data in binary format.  <a href="classsmall3d_1_1_model.html#ab20d35ec5c791220790e149546c37553">More...</a><br /></td></tr>
<tr class="separator:ab20d35ec5c791220790e149546c37553"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a796ca67051aba11b126ccccaf16c9526"><td class="memTemplParams" colspan="2"><a id="a796ca67051aba11b126ccccaf16c9526"></a>
template&lt;class Archive &gt; </td></tr>
<tr class="memitem:a796ca67051aba11b126ccccaf16c9526"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><b>serialize</b> (Archive &amp;archive)</td></tr>
<tr class="separator:a796ca67051aba11b126ccccaf16c9526"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a809cd09097b9e123813565008add1fe6"><td class="memItemLeft" align="right" valign="top"><a id="a809cd09097b9e123813565008add1fe6"></a>
<a class="el" href="classsmall3d_1_1_material.html">Material</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a809cd09097b9e123813565008add1fe6">material</a></td></tr>
<tr class="memdesc:a809cd09097b9e123813565008add1fe6"><td class="mdescLeft">&#160;</td><td class="mdescRight">The material of the model. <br /></td></tr>
<tr class="separator:a809cd09097b9e123813565008add1fe6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39352fd779afaef6ee5ef398a0481b31"><td class="memItemLeft" align="right" valign="top"><a id="a39352fd779afaef6ee5ef398a0481b31"></a>
glm::vec3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a39352fd779afaef6ee5ef398a0481b31">scale</a> = glm::vec3(1.0f, 1.0f, 1.0f)</td></tr>
<tr class="memdesc:a39352fd779afaef6ee5ef398a0481b31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Use this to scale the model and not origScale. <br /></td></tr>
<tr class="separator:a39352fd779afaef6ee5ef398a0481b31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0c58e6b9ead5c0ba861d12425a73038"><td class="memItemLeft" align="right" valign="top"><a id="ae0c58e6b9ead5c0ba861d12425a73038"></a>
std::shared_ptr&lt; <a class="el" href="classsmall3d_1_1_image.html">Image</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#ae0c58e6b9ead5c0ba861d12425a73038">defaultTextureImage</a></td></tr>
<tr class="memdesc:ae0c58e6b9ead5c0ba861d12425a73038"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classsmall3d_1_1_image.html" title="An image, loaded from a .png file, which can be used for generating textures.">Image</a> found in the file the model was loaded from (empty image if not - check the size). It can be used to generate a texture for the model, but other textures can also be used. <br /></td></tr>
<tr class="separator:ae0c58e6b9ead5c0ba861d12425a73038"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf9422b7594956d857bc9da9da7b13e4"><td class="memItemLeft" align="right" valign="top"><a id="adf9422b7594956d857bc9da9da7b13e4"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#adf9422b7594956d857bc9da9da7b13e4">vertexData</a></td></tr>
<tr class="memdesc:adf9422b7594956d857bc9da9da7b13e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">The vertex data. This is an array, which is to be treated as a 4 column table, holding the x, y, z values in each column. The fourth column is there to assist in matrix operations. <br /></td></tr>
<tr class="separator:adf9422b7594956d857bc9da9da7b13e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06b724ca272d632f25098e25ab0137a4"><td class="memItemLeft" align="right" valign="top"><a id="a06b724ca272d632f25098e25ab0137a4"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a06b724ca272d632f25098e25ab0137a4">vertexDataByteSize</a> = 0</td></tr>
<tr class="memdesc:a06b724ca272d632f25098e25ab0137a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the vertex data, in bytes. <br /></td></tr>
<tr class="separator:a06b724ca272d632f25098e25ab0137a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c99ee7bef5dff9f4ac313af643952d6"><td class="memItemLeft" align="right" valign="top"><a id="a7c99ee7bef5dff9f4ac313af643952d6"></a>
std::vector&lt; uint16_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a7c99ee7bef5dff9f4ac313af643952d6">indexData</a></td></tr>
<tr class="memdesc:a7c99ee7bef5dff9f4ac313af643952d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">3 column table. Each element refers to a "row" in the vertex data table. Each "row" in the index data table forms a triangle. <br /></td></tr>
<tr class="separator:a7c99ee7bef5dff9f4ac313af643952d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85d48b3995956a4ee42dc8c34b195ad7"><td class="memItemLeft" align="right" valign="top"><a id="a85d48b3995956a4ee42dc8c34b195ad7"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a85d48b3995956a4ee42dc8c34b195ad7">indexDataByteSize</a> = 0</td></tr>
<tr class="memdesc:a85d48b3995956a4ee42dc8c34b195ad7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the index data, in bytes. <br /></td></tr>
<tr class="separator:a85d48b3995956a4ee42dc8c34b195ad7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9e45810ced27f9336e2e77bca2f8ba6"><td class="memItemLeft" align="right" valign="top"><a id="aa9e45810ced27f9336e2e77bca2f8ba6"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#aa9e45810ced27f9336e2e77bca2f8ba6">normalsData</a></td></tr>
<tr class="memdesc:aa9e45810ced27f9336e2e77bca2f8ba6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Array, to be treated as a 3 column table. Each "row" contains the x, y and z components of the vector representing the normal of a vertex. The position of the "row" in the array is the same as the position of the corresponding vertex "row" in the vertexData array. <br /></td></tr>
<tr class="separator:aa9e45810ced27f9336e2e77bca2f8ba6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab62bf9713060f68517cb7ec34186e884"><td class="memItemLeft" align="right" valign="top"><a id="ab62bf9713060f68517cb7ec34186e884"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#ab62bf9713060f68517cb7ec34186e884">normalsDataByteSize</a> = 0</td></tr>
<tr class="memdesc:ab62bf9713060f68517cb7ec34186e884"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the normals data, in bytes. <br /></td></tr>
<tr class="separator:ab62bf9713060f68517cb7ec34186e884"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3dc1c38f06ad7bd19126933197e7b443"><td class="memItemLeft" align="right" valign="top"><a id="a3dc1c38f06ad7bd19126933197e7b443"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a3dc1c38f06ad7bd19126933197e7b443">textureCoordsData</a></td></tr>
<tr class="memdesc:a3dc1c38f06ad7bd19126933197e7b443"><td class="mdescLeft">&#160;</td><td class="mdescRight">Array, to be treated as a 2 column table. Each "row" contains the x and y components of the pixel coordinates on the model's texture image for the vertex in the corresponding "row" of the vertex data "table". <br /></td></tr>
<tr class="separator:a3dc1c38f06ad7bd19126933197e7b443"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3351123ddee47d7b81b9a020ca828061"><td class="memItemLeft" align="right" valign="top"><a id="a3351123ddee47d7b81b9a020ca828061"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a3351123ddee47d7b81b9a020ca828061">textureCoordsDataByteSize</a> = 0</td></tr>
<tr class="memdesc:a3351123ddee47d7b81b9a020ca828061"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the texture coordinates data, in bytes. <br /></td></tr>
<tr class="separator:a3351123ddee47d7b81b9a020ca828061"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa75d379c3808bfce41889f918656b87f"><td class="memItemLeft" align="right" valign="top"><a id="aa75d379c3808bfce41889f918656b87f"></a>
std::vector&lt; uint8_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#aa75d379c3808bfce41889f918656b87f">jointData</a></td></tr>
<tr class="memdesc:aa75d379c3808bfce41889f918656b87f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Array, to be treated as a 4 column table. Each "row" potentially contains up to 4 joints that can influence each vertex. <br /></td></tr>
<tr class="separator:aa75d379c3808bfce41889f918656b87f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ed04786c848d0ef209c80973dfa26e2"><td class="memItemLeft" align="right" valign="top"><a id="a6ed04786c848d0ef209c80973dfa26e2"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a6ed04786c848d0ef209c80973dfa26e2">jointDataByteSize</a> = 0</td></tr>
<tr class="memdesc:a6ed04786c848d0ef209c80973dfa26e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the joint data, in bytes. <br /></td></tr>
<tr class="separator:a6ed04786c848d0ef209c80973dfa26e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41ca4152abcc719e9048258925999f10"><td class="memItemLeft" align="right" valign="top"><a id="a41ca4152abcc719e9048258925999f10"></a>
std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a41ca4152abcc719e9048258925999f10">weightData</a></td></tr>
<tr class="memdesc:a41ca4152abcc719e9048258925999f10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Array, to be treated as a 4 column table. Each "row" contains the weights by which each of the corresponding joints affect each vertex. <br /></td></tr>
<tr class="separator:a41ca4152abcc719e9048258925999f10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f8f0d5bf988d89b3cf7c6c16bc2871e"><td class="memItemLeft" align="right" valign="top"><a id="a0f8f0d5bf988d89b3cf7c6c16bc2871e"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#a0f8f0d5bf988d89b3cf7c6c16bc2871e">weightDataByteSize</a> = 0</td></tr>
<tr class="memdesc:a0f8f0d5bf988d89b3cf7c6c16bc2871e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Size of the weight data, in bytes. <br /></td></tr>
<tr class="separator:a0f8f0d5bf988d89b3cf7c6c16bc2871e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab90cce419400675c73e1196cdcb679d8"><td class="memItemLeft" align="right" valign="top"><a id="ab90cce419400675c73e1196cdcb679d8"></a>
std::vector&lt; <a class="el" href="structsmall3d_1_1_model_1_1_joint.html">Joint</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#ab90cce419400675c73e1196cdcb679d8">joints</a></td></tr>
<tr class="memdesc:ab90cce419400675c73e1196cdcb679d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">The model's joints. <br /></td></tr>
<tr class="separator:ab90cce419400675c73e1196cdcb679d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac97a1368278ce6bf42d14470e8270dc9"><td class="memItemLeft" align="right" valign="top"><a id="ac97a1368278ce6bf42d14470e8270dc9"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#ac97a1368278ce6bf42d14470e8270dc9">noShadow</a> = false</td></tr>
<tr class="memdesc:ac97a1368278ce6bf42d14470e8270dc9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Should the model produce a shadow? <br /></td></tr>
<tr class="separator:ac97a1368278ce6bf42d14470e8270dc9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:ad2b52d176f49562bca07f9b238b84854"><td class="memItemLeft" align="right" valign="top"><a id="ad2b52d176f49562bca07f9b238b84854"></a>
static const uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsmall3d_1_1_model.html#ad2b52d176f49562bca07f9b238b84854">MAX_JOINTS_SUPPORTED</a> = 32</td></tr>
<tr class="memdesc:ad2b52d176f49562bca07f9b238b84854"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum number of supported joints. <br /></td></tr>
<tr class="separator:ad2b52d176f49562bca07f9b238b84854"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a6ae53f845e04b19a83a6750b540520e0"><td class="memItemLeft" align="right" valign="top"><a id="a6ae53f845e04b19a83a6750b540520e0"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>GlbFile</b></td></tr>
<tr class="separator:a6ae53f845e04b19a83a6750b540520e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70538530bc36e033e360880ef311df61"><td class="memItemLeft" align="right" valign="top"><a id="a70538530bc36e033e360880ef311df61"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>Renderer</b></td></tr>
<tr class="separator:a70538530bc36e033e360880ef311df61"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A 3D model. It can be loaded from a <a class="el" href="classsmall3d_1_1_wavefront_file.html" title=".obj (Wavefront) file parser class. The file format has to be somewhat specific, with triangulated fa...">WavefrontFile</a> or <a class="el" href="classsmall3d_1_1_glb_file.html" title=".glb (glTF) file parser class. It can load meshes, textures and linear animations from samplers with ...">GlbFile</a>. It can also be constructed procedurally by code, by inserting values to the appropriate member variables. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a0c2157a917298623136e6eea94ac67bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c2157a917298623136e6eea94ac67bd">&#9670;&nbsp;</a></span>Model() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">small3d::Model::Model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsmall3d_1_1_file.html">File</a> &amp;&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>meshName</em> = <code>&quot;&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">file</td><td>The file parsing object from which to load the model </td></tr>
    <tr><td class="paramname">meshName</td><td>The name of the model mesh in the file </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="acc694ba2760a1a3fa8775e6abe1a0d0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc694ba2760a1a3fa8775e6abe1a0d0e">&#9670;&nbsp;</a></span>Model() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">small3d::Model::Model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsmall3d_1_1_file.html">File</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>meshName</em> = <code>&quot;&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor (rvalue file - helps for declaring the file on the fly when using gcc) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">file</td><td>The file parsing object from which to load the model </td></tr>
    <tr><td class="paramname">meshName</td><td>The name of the model mesh in the file </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a6100343932704c5e7a647a13aaae7586"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6100343932704c5e7a647a13aaae7586">&#9670;&nbsp;</a></span>getJointTransform()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">glm::mat4 small3d::Model::getJointTransform </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>jointIdx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>animationIdx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>currentPose</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>seconds</em> = <code>0.0f</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get a joint transform, also calculating the transorms of the parent joints in the same tree and the animations, if any exist. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">jointIdx</td><td>The index of the joint in the list of joints </td></tr>
    <tr><td class="paramname">animationIdx</td><td>The index of the animation to use </td></tr>
    <tr><td class="paramname">currentPose</td><td>The pose of the animation to calculate the joint transformation for. </td></tr>
    <tr><td class="paramname">seconds</td><td>The animation moment (in seconds) - mostly used internally </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The transform </dd></dl>

</div>
</div>
<a id="a017c394b7f032e79786f043df8ca0fb9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a017c394b7f032e79786f043df8ca0fb9">&#9670;&nbsp;</a></span>getNumAnimations()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t small3d::Model::getNumAnimations </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the number of available animations. </p>
<dl class="section return"><dt>Returns</dt><dd>The number of animations </dd></dl>

</div>
</div>
<a id="ab45b976e6906c2f86ae5d47d90ed3cd6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab45b976e6906c2f86ae5d47d90ed3cd6">&#9670;&nbsp;</a></span>getNumPoses()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint64_t small3d::Model::getNumPoses </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the number of animation poses in the current animation. </p>
<dl class="section return"><dt>Returns</dt><dd>The number of animation poses </dd></dl>

</div>
</div>
<a id="ab20d35ec5c791220790e149546c37553"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab20d35ec5c791220790e149546c37553">&#9670;&nbsp;</a></span>saveBinary()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void small3d::Model::saveBinary </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>binaryFilePath</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Save model data in binary format. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">binaryFilePath</td><td>Path of file to save binary data to. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a7ae390be2c19fcbd81829341fc8cafa3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ae390be2c19fcbd81829341fc8cafa3">&#9670;&nbsp;</a></span>setAnimation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void small3d::Model::setAnimation </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>animationIdx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the current animation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">animationIdx</td><td>The index of the current animation </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_model_8hpp_source.html">Model.hpp</a></li>
<li>Model.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
